package com.uzai.console.web.md;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSort;
import com.uzai.console.dto.md.mdactivity.MdActivityIdDto;
import com.uzai.console.dto.md.tljdetail.TljDetailIdDto;
import com.uzai.console.dto.md.tljdetail.TljDetailQuery;
import com.uzai.console.service.md.tljdetail.TljDetailService;
import com.uzai.console.vo.md.tljdetail.TljDetailVo;
import com.uzai.console.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author liuqi
 * @date 2021年08月25日 20:15
 */
@Api(value = "免单淘礼金",tags = "免单管理|免单淘礼金")
@ApiSort(60)
@RestController
public class TljDetailContoller extends BaseController {
    private Logger logger = LoggerFactory.getLogger(TljDetailContoller.class);

    @Autowired
    private TljDetailService tljDetailService;

    @ApiOperation(value = "查询所有淘礼金列表", notes = "查询所有淘礼金列表", response = TljDetailVo.class)
    @ApiOperationSupport(order = 1)
    @PostMapping("/tljDetail/findTljDetailList")
    public Object findTljDetailList(@RequestBody TljDetailQuery tljDetailQuery){
        return tljDetailService.findTljDetailList(tljDetailQuery);
    }

    @ApiOperation(value = "查询淘礼金详情", notes = "查询淘礼金详情", response = TljDetailVo.class)
    @ApiOperationSupport(order = 2)
    @PostMapping("/tljDetail/findTljDetail")
    public Object findTljDetail(@RequestBody TljDetailIdDto tljDetailIdDto){
        return tljDetailService.findTljDetail(tljDetailIdDto);
    }

    @ApiOperation(value = "删除淘礼金", notes = "删除淘礼金", response = Boolean.class)
    @ApiOperationSupport(order = 3)
    @PostMapping("/tljDetail/deleteTljDetail")
    public Object deleteTljDetail(@RequestBody TljDetailIdDto tljDetailIdDto){
        tljDetailService.deleteTljDetail(tljDetailIdDto);
        return true;
    }

}
